package com.itheima_02;

import java.util.Scanner;

public class StringBuilder04 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String s = sc.nextLine();
        StringBuilder sb = new StringBuilder(s);//将String类型的字符串s转换为可改变的StringBuilder类型字符串sb
        sb.reverse();//对sb进行反转操作
        String s1 = sb.toString();//将StringBuilder类型字符串sb转换为String类型的字符串
        if ( s1.equals(s)) {//将同类型的s1和s2进行内容比较
            System.out.println("对称字符串");
        } else {
            System.out.println("非对称字符串");
        }
    }
}
